 package com.lf.easyapi.enums;

/**
 * 封装 	错误码、错误信息
 * 
 * @author 吴熙瑞
 * @date   2015-05-07
 */
public enum Messages {
//	//公共错误
	SYSTEM_ERROR(1000, "系统异常"), 
	PARAM_ERROR(1001, "参数错误"), 
	MODEL_NOT_EXIST(1002, "对象不存在"),
	MODEL_IS_DELETED(1003, "对象已删除"),
	AUTH_NOT_LOGIN(1004, "该操作需先登录"),
	
	EXECUTE_ADD_FAILED(1101, "执行添加操作失败"),
	EXECUTE_DELETE_FAILED(1102, "执行删除操作失败"),
	EXECUTE_UPDATE_FAILED(1103, "执行更新操作失败"),
	EXECUTE_QUERY_FAILED(1104, "执行查询操作失败"),
	EXECUTE_SEARCH_FAILED(1105, "执行搜索操作失败"),
	
	//上传相关
	FILE_INFO_NO_EXIST(1010, "文件记录不存在"), 
	FILE_INFO_DELETE_ERROR(1011, "文件记录删除失败"), 
	FILE_DELETE_ERROR(1012, "文件删除失败"), 
	FILE_DETAIL_GET_ERROR(1013, "获取详细信息失败"),
	FILE_INFO_STATUS_LIMIT(1014, "当前状态不允许该操作"),
	
	//收藏
	FAVORITE_DONE(1050, "已经收藏过");
	
	/**
	 * 错误码
	 */
	private Integer code;
	
	/**
	 * 错误信息
	 */
	private String message;

	private Messages(Integer code, String message) {
		this.code = code;
		this.message = message;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public int getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}
}
